﻿using FluentNHibernate.Mapping;
using SimpleScrum.Core.Entities;

namespace SimpleScrum.Core.Mappings
{
    public class UsersMap : ClassMap<Users>
    {
        public UsersMap()
        {
            Table("Users");
            LazyLoad();
            Id(x => x.Id).Column("ID").GeneratedBy.GuidComb();
            Map(x => x.LastName).Column("LastName").Length(20);
            Map(x => x.FirstName).Column("FirstName").Length(20);
            Map(x => x.Email).Column("Email").Length(56);
            Map(x => x.Gender).Column("Gender").Length(6);
            Map(x => x.JoinDate).Column("JoinDate");
            Map(x => x.Type).Column("TypeID");
            Map(x => x.Status).Column("StatusID");
            Map(x => x.LastLogin).Column("LastLogin");
            References(x => x.DefaultProject).Column("DefaultProjectId");
            //References(x => x.UserId).Column("UserId").Cascade.All();
        }
    }
}